package com.hzqy.persistence.dao.itf;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.PmsOrgVo;
import com.hzqy.web.vo.YxtAcountInfoVo;

@Repository
public class YxtDao extends PersistenceDao<CmContentVo, Integer>{

	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	public int updateServerAccount(String serverid, String account) {
		Map<String, String> params = new HashMap<String, String>();
		params.put("serverid", serverid);
		params.put("account", account);
		return getSqlSession().update(this.getNamespace() + "updateServerAccount", params);
	}
	
	public int deleteAccountByid(int f_yai_id){
		return getSqlSession().update(this.getNamespace() + "deleteAccountByid", f_yai_id);
	}
	
	
	public List<YxtAcountInfoVo> selectYxtAccountInfoList(String f_yai_account){
		return getSqlSession().selectList(this.getNamespace() + "selectYxtAccountInfoList", f_yai_account);
	}
	
	public int insertAccountInfo(YxtAcountInfoVo yxtAcountInfoVo){
		return getSqlSession().insert(this.getNamespace() + "insertAccountInfo", yxtAcountInfoVo);
	}
	
	public int updateAccountInfo(YxtAcountInfoVo yxtAcountInfoVo){
		return getSqlSession().update(this.getNamespace() + "updateAccountInfo", yxtAcountInfoVo);
	}
	
	public int deleteByAccount(String account){
		return getSqlSession().update(this.getNamespace() + "deleteByAccount", account);
	}

	public PmsOrgVo selectOrgByName(String f_po_name){
		return getSqlSession().selectOne(this.getNamespace() + "selectOrgByName", f_po_name);
	}
	
	public int updateServeridBindOrg(String serverid, int f_po_id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("serverid", serverid);
		params.put("f_po_id", f_po_id);
		return getSqlSession().update(this.getNamespace() + "updateServeridBindOrg", params);
	}

	public CmContentVo selectContentByYxtId(String id) {
		return getSqlSession().selectOne(this.getNamespace() + "selectContentByYxtId", id);
	}
	
	
}
